package ru.spbau.database.group3.index;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ru.spbau.database.group3.engine.Column;
import ru.spbau.database.group3.engine.Condition;
import ru.spbau.database.group3.filesAndAccess.Record;

public class RecordSearchSample extends Record {
	
	private Map<Column, Object> values;
	
	public RecordSearchSample(Condition condition) {
		super(0,0);
		values = new HashMap<Column, Object>();
		values.put(condition.getColumn(), condition.getValue());
	}
	
	public RecordSearchSample(Collection<Condition> conditions) {
		super(0,0);
		values = new HashMap<Column, Object>();
		for (Condition c : conditions) {
			values.put(c.getColumn(), c.getValue());
		}
	}
	
	@Override
    public Object getColumnValue(Column column) throws IOException {
        return values.get(column);
    }
}
